package pl.edu.agh.gronoMining.frequentSubgraphFinder.strategy;

/**
 * Object of this type contains pair of integers. Used by SimpleStrategyImpl to store pair (nodeType1, nodeType2) 
 */

public class RulePair {

	private int firstNodeType, nextNodeType;
	
	public RulePair(int firstNodeType, int nextNodeType) {
		this.firstNodeType = firstNodeType;
		this.nextNodeType = nextNodeType;
	}
	
	public int getFirstNodeType() {
		return firstNodeType;
	}
	
	public int getNextNodeType() {
		return nextNodeType;
	}
	
	public boolean equals(Object equalsTo) {
		RulePair rp = (RulePair) equalsTo;
		if (rp.getFirstNodeType() == firstNodeType && rp.getNextNodeType() == nextNodeType)
			return true;
		else
			return false;
	}
	
	public int hashCode() {
		int hash1 = new Integer(this.firstNodeType).hashCode();
		int hash2 = new Integer(this.firstNodeType).hashCode();
		return hash1+hash2;
	}
	
}
